<?php
/**
* @package RAM_AreaSectorSearch
* @version 1.5.0 Stable, September 2009
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Check for any error message from our helper
//if ($msg!='') { echo "<p>$msg</p>\n"; }

// display the list of sectors retrieved by our helper
$url = JRoute::_( "index.php?option=com_recruitmentmanager&task=search&Itemid=18");
$session = JFactory::getSession();
$searchArr = $session->get('isSearch');
?>
<div class="search-block">
	<h2><?php echo $intro_para; ?></h2>
	<form class="search01-form" method="post" action="<?php echo $url?>" name="searchForm">
		<input type="hidden" name="option" value="com_recruitmentmanager" />
		<input type="hidden" name="task" value="search" />
		<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
		
		<input name="searchfor" type="text" placeholder="Keyword..." value="<?php echo @$searchArr['searchfor']?>"/>
		
		<select class="selectbox" name="sector">
			<option value="">Any Industry...</option>
		<?php
		$selected = '';
		for ($n=0;$n<count($sectors);$n++) {
			if(isset($searchArr['sector'])) {
				if($searchArr['sector'] == $sectors[$n]['id']) $selected = 'selected';
				else $selected = '';
			}
			echo "<option value='" . $sectors[$n]['id'] . "' ". $selected .">" . $sectors[$n]['desc'] . "</option>\n";
		} // eof for loop
		?>
		</select>
		
		<select class="selectbox" name="area">
				<option value="">Any Location...</option>
		<?php
		for ($n=0;$n<count($areas);$n++) {
			if(isset($searchArr['area'])) {
				if($searchArr['area'] == $areas[$n]['id']) $selected = 'selected';
				else $selected = '';
			}
			echo "<option value='" . $areas[$n]['id'] . "' ". $selected .">" . $areas[$n]['Country'] . ', ' . $areas[$n]['County'] . "</option>\n";
		} // eof for loop
		?>
		</select>
		
		<select class="selectbox" name="salary">
				<option value="">Any Salary...</option>
		<?php
		for ($n=0;$n<count($salary);$n++) {
			if(isset($searchArr['salary'])) {
				if($searchArr['salary'] == $areas[$n]['id']) $selected = 'selected';
				else $selected = '';
			}
			echo "<option value='" . $salary[$n]['id'] . "' ". $selected .">" . $salary[$n]['desc'] . "</option>\n";
		} // eof for loop
		?>
		</select>
		<button type="submit" name="search" class="search01">Search</button>
	</form>
</div>
